import {createRouter, createWebHistory} from "vue-router";
import Index from "@/views/index/index.vue";

const routes = [
    {
        path: "/",
        name: "首页",
        component: Index,
    },
    {
        path: "/sponsor",
        name: "赞助",
        component: () => import("@/views/sponsor/sponsor.vue"),
    },
    {
        path: "/say",
        name: "说说",
        component: () => import("@/views/say/say.vue"),
    },
    {
        path: "/favorite",
        name: "百宝箱",
        component: () => import("@/views/favorite/favorite.vue"),
    },
    {
        path: "/hot",
        name: "热搜",
        component: () => import("@/views/hot/hot.vue"),
    },
    {
        path: "/message",
        name: "留言板",
        component: () => import("@/views/message/message.vue"),
    },
    {
        path: "/friends",
        name: "友人帐",
        component: () => import("@/views/friends/friends.vue"),
    },
    {
        path: "/about/",
        name: "关于本站",
        children: [
            {
                path: "station",
                name: "关于本站",
                component: () => import("@/views/about/station/station.vue"),
            },
        ],
    },
    {
        path: "/user/",
        name: "用户",
        children: [
            {
                path: "login",
                name: "登录",
                component: () => import("@/views/user/login/login.vue"),
            },
            {
                path: "register",
                name: "注册",
                component: () => import("@/views/user/register/register.vue"),
            }
        ],
    },
    {
        path: "/:pathMatch(.*)",
        name: "NotFound",
        component: () => import("@/components/common/not-found/NotFound.vue"),
    }
];

const router = createRouter({
    routes,
    history: createWebHistory(),
});

export default router;